import dome05.bean.Student;
import dome05.dao.StudentDao;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudentTest05 {
    @Test
    public void StudentTest05() {

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("Student05.xml");

        StudentDao studentDao = context.getBean("studentDao05", StudentDao.class);


        Student student01 = new Student( "111", "张三", "男", "1班", "大一");
        Student student02 = new Student( "222", "李四", "女", "2班", "大二");
        Student student03 = new Student( "333", "王五", "男", "3班", "大三");

        int i =studentDao.insertStudent(student01);
        int j =studentDao.insertStudent(student02);
        int k =studentDao.insertStudent(student03);

        Student student04 = new Student( "444", "赵六", "女", "4班", "大四");
        int l =studentDao.updateStudent(student04, "张三");


        System.out.println(studentDao.selectStudent("444"));

        System.out.println(studentDao.FindAllStudent());
    }
}
